package com.example.intelligentattendancesystem.pojo;

import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Objects;

/**
 * @author tonyblack
 * @version 1.0
 * @since 1.0
 */
@Component
public class History {
    private Integer id;
    private int userId;
    private String signInTime;
    private String signOutTime;
    private String signPosition;//只记录签到时间

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        History history = (History) o;
        return userId == history.userId && Objects.equals(id, history.id) && Objects.equals(signInTime, history.signInTime) && Objects.equals(signOutTime, history.signOutTime) && Objects.equals(signPosition, history.signPosition);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, signInTime, signOutTime, signPosition);
    }

    @Override
    public String toString() {
        return "History{" +
                "id=" + id +
                ", userId='" + userId + '\'' +
                ", signInTime=" + signInTime +
                ", signOutTime=" + signOutTime +
                ", signPosition='" + signPosition + '\'' +
                '}';
    }

    public History(Integer id, int userId, String signInTime, String signOutTime, String signPosition) {
        this.id = id;
        this.userId = userId;
        this.signInTime = signInTime;
        this.signOutTime = signOutTime;
        this.signPosition = signPosition;
    }

    public History() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getSignInTime() {
        return signInTime;
    }

    public void setSignInTime(String signInTime) {
        this.signInTime = signInTime;
    }

    public String getSignOutTime() {
        return signOutTime;
    }

    public void setSignOutTime(String signOutTime) {
        this.signOutTime = signOutTime;
    }

    public String getSignPosition() {
        return signPosition;
    }

    public void setSignPosition(String signPosition) {
        this.signPosition = signPosition;
    }


}
